<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('角色列表')" />
</head>
<body class="gray-bg">

<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var detailFlag = [[${@permission.hasPermi('storage:ware:remove')}]];
    var prefix = ctx + "statis/Rk";


    $(function() {
        var options = {
            url: prefix + "/listdetail",
            // createUrl: prefix + "/add",
            detailUrl: prefix + "/details2/{id}",
            // updateUrl: prefix + "/edit/{id}",
            // removeUrl: prefix + "/remove",
            modalName: "仓库",
            columns: [{
                checkbox: true
            },
                {    field: 'rkId',
                    title: "序号",
                    // formatter: function (value, row, index) {
                    // 	return $.table.serialNumber(index);
                    // }
                },
                {
                    field: 'rkwareName',
                    title: '仓库名称',
                },
                {
                    field: 'sysChargeUser',
                    title: '采购单编号',
                },
                {
                    field: 'cityName',
                    title: '商品数量',

                },

                {
                    field: 'rkstauscount',
                    title: '金额',
                    formatter: function (value, row, index) {
                        return '￥'+value;
                    }
                },
                {
                    field: 'totalMoney',
                    title: '入库时间',

                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        if (row.rkId!= 0) {
                            var action = [];
                            action.push('<a class="btn btn-success btn-sm" style="margin-right: 5px" onclick="$.operate.detail('+ row.rkId +')">查看详情</a>');
                            action.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.rkId+ '\')"><i class="fa fa-edit"></i>查看详情</a> ');
                            return action.join('');
                        } else {
                            return "";
                        }
                    }
                }]
        };
        $.table.init(options);
    });

    // function isAble(op,id) {
    // 	$.ajax({
    // 		cache : true,
    // 		type : "POST",
    // 		url : ctx + "storage/ware/editStatus",
    // 		data : {
    // 			"wareId": id,
    // 			"repoStatus": op
    // 		},
    // 		async : false,
    // 		error : function(request) {
    // 			$.modal.alertError("系统错误");
    // 		},
    // 		success : function(data) {
    // 			$.operate.successCallback(data);
    // 		}
    // 	});
    // }

    $("#pr").change(function () {
        $.get("/statis/Rk/city/" + $("#pr").val(),{},function (data) {
            let options = '';
            for (let i = 0; i < data.length; i++) {
                options += '<option value="'+ data[i].cityId +'">'+ data[i].cityName +'</option>'
            }

            $("#city").html(options);
        })
    })
</script>
</body>
</html>